Pass every terminal host's env through safehouse, and only what exists - #730
Merged
Merged
Conversation
… filter terminalTargetingEnvArgs gated on bare ZELLIJ and passed a fixed three-name list regardless of what was actually set, so tmux/Herdr/CMUX/ Ghostty/Apple Terminal parents lost all terminal-host identity crossing the safehouse boundary, and unset Zellij names could reach the child. Replace it with terminalEnvPassArgs, a pure presence filter over subspace's own nine-signal probe set (injectable lookup for deterministic unit tests), emitted in probe order; a name appears only when LookupEnv reports it set in the parent. Reshapes the Wrap allowance test and cli env-pass smoke fixtures to the tmux pair (bare ZELLIJ is gone from the vocabulary), and widens the terminal-independent test hygiene (clear-helpers, TestMain baseline) to all nine names so the suite passes identically under tmux, Zellij, or a bare terminal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
env | grep TMUXreturned nothing inside a safehouse-wrapped session. The frontdoor was not the cause —launchEnvforwards the whole parent environment and only swapsSPACEDOCK_BIN. The loss was at the sandbox boundary.terminalTargetingEnvArgsgated its entire allowance on one sentinel:No
ZELLIJmeant nothing was passed at all. So a tmux session reached the child with noTMUXand noTMUX_PANE, and five of six terminal hosts lost their identity crossing into the sandbox. WhenZELLIJwas present, all three names were emitted whether set or not — andZELLIJis not one of the two variables the consumer actually probes.The visible consequence: inside safehouse, the
subspace:rskill resolves Zellij or falls through to none. A captain in tmux, Herdr, CMUX, Ghostty, or Apple Terminal gets the fallback instead of their real pane. That was reproduced live during this work — a review opened toward a detached Terminal tab rather than the caller's tmux split.What changed
One list of the nine signals
subspace:rprobes across its six hosts, and one presence filter over it. A name is emitted only when the parent has that variable; an empty parent yields no allowance at all. The lookup is injected, so the composer is testable without touching the process environment.Four recorded decisions: drop the bare
ZELLIJname, which no live consumer probes; keepTERM_PROGRAMvalue-agnostic rather than embedding the consumer's resolution semantics; treat presence asLookupEnv, including set-but-empty; duplicate the nine names rather than build a cross-repository mechanism, because drift degrades to today's behavior or to a diagnosable probe stop, never to a wrong pane.Evidence
The measuring criterion could not be proven from inside the sandbox — no wrapped session can execute
safehouse, and validation confirmed that independently rather than substituting unit evidence for it. It was closed by a captain-run comparison outside the sandbox, in a real tmux session: the consumer's own nine-signal probe, run bare and then wrapped.All nine signals matched.
TMUXandTMUX_PANEread present inside, where they read absent before. The other six read absent in both, so nothing is invented.The composer was also exercised against real compiled production code under a real process environment, and validation judged the test cases against 11 mutations, finding them not padded with one exception it named.
Surface: 4 files, net +135, of which production is +26. That is 3.0x the ideation estimate, disclosed and judged case by case rather than absorbed.
89b